﻿<UserControl x:Class="ScrumFactory.Tasks.FinishTaskDialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:props="clr-namespace:ScrumFactory.Tasks.Properties"
             mc:Ignorable="d" 
             xmlns:SF_Ext="clr-namespace:ScrumFactory.Windows.Helpers.Extensions;assembly=ScrumFactory.Windows.Helpers"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid MinWidth="400">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width=".2*"/>
            <ColumnDefinition Width=".5*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>            
        </Grid.RowDefinitions>
        <TextBox
                Grid.ColumnSpan="2" Grid.Row="0"
                IsReadOnly="True" Style="{StaticResource CleanTextBox}" Margin="0"
                Foreground="{StaticResource LinkBrush}" HorizontalAlignment="Right"
                Text="{Binding Task, Converter={StaticResource TaskTrackIdConverter}}"/>            
            
        <TextBlock
                Grid.ColumnSpan="2" Grid.Row="1" Foreground="Black" Margin="3,0,3,3"
                FontSize="{StaticResource ReallyBigFontSize}"
                Text="{Binding Task.TaskName}" TextWrapping="Wrap"/>
        
        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="2" HorizontalAlignment="Center">
            <TextBlock                        
                Text="{Binding FormatedEllipsedHours}" FontSize="{StaticResource ReallyBigFontSize}"
                Style="{StaticResource LabelTextBlock}" VerticalAlignment="Center" Margin="5,0,5,0"
                FontWeight="Bold"/>
            <TextBlock                    
                Text="+" FontSize="{StaticResource ReallyBigFontSize}" FontWeight="Bold" Margin="5,0,5,0" Style="{StaticResource LabelTextBlock}"/>
            <TextBox                        
                SF_Ext:TextBoxExtension.AutoSelectOnFocus="True" MinWidth="80" 
                Text="{Binding AddingHours, StringFormat='{}{0:0.##}', UpdateSourceTrigger=PropertyChanged}" MaxLength="4" TextAlignment="Right" FontSize="{StaticResource ReallyBigFontSize}" FontWeight="Bold"/>
            <TextBlock                    
                Text="hrs" FontSize="{StaticResource ReallyBigFontSize}" FontWeight="Bold" Margin="5,0,5,0" Style="{StaticResource LabelTextBlock}" VerticalAlignment="Center" />

        </StackPanel>
        
        
        
        
        <TextBlock Grid.ColumnSpan="2" Grid.Row="3"  Margin="2,20,0,15" >
            <Image Source="/Images/Toolbar/tag.png" Width="16" Height="16"/>
            <Hyperlink Command="{Binding CopyTaskTrackIdCommand}">                
                <TextBlock Text="{x:Static props:Resources.copy_track_info_to_clipboard}"/>
            </Hyperlink>            
        </TextBlock>

        <Border
                HorizontalAlignment="Stretch"
                Background="{StaticResource WindowButtonBar}"
                Grid.ColumnSpan="2" Grid.Row="4">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
                <Button
                    MinWidth="80" Margin="5" HorizontalAlignment="Center"
                    Command="{Binding FinishTaskCommand}"
                    Content="{x:Static props:Resources.Finish}"/>
                <Button
                    MinWidth="80" Margin="5" HorizontalAlignment="Center"
                    Command="{Binding CancelCommand}"
                    Content="{x:Static props:Resources.Cancel}"/>
            </StackPanel>
            
        </Border>

    </Grid>
</UserControl>
